package com.jf.thread;

public class SetThread extends Thread {
    private BaoZiPu bzp;
    public SetThread(BaoZiPu bzp){
        this.bzp = bzp;
    }

    @Override
    public void run() {
        while (true){
            if(this.bzp.count > 100){
                System.out.println("没有馅了");
                break;
            }
            try {
                sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            bzp.setBaozi("香菇青菜包");
        }
    }
}
